home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr27 / gs26.zip / PPATH.PS < prev    next >
Text File  |  1993-01-31  |  2KB  |  52 lines

  1. %    Copyright (C) 1989, 1992, 1993 Aladdin Enterprises.  All rights reserved.
  2. %    Distributed by Free Software Foundation, Inc.
  3. %
  4. % This file is part of Ghostscript.
  5. %
  6. % Ghostscript is distributed in the hope that it will be useful, but
  7. % WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  8. % to anyone for the consequences of using it or for whether it serves any
  9. % particular purpose or works at all, unless he says so in writing.  Refer
  10. % to the Ghostscript General Public License for full details.
  11. %
  12. % Everyone is granted permission to copy, modify and redistribute
  13. % Ghostscript, but only under the conditions described in the Ghostscript
  14. % General Public License.  A copy of this license is supposed to have been
  15. % given to you along with Ghostscript so you can know your rights and
  16. % responsibilities.  It should be in a file named COPYING.  Among other
  17. % things, the copyright notice and this notice must be preserved on all
  18. % copies.
  19.  
  20. % Redefine pathforall for tracing.
  21. % Can't be used recursively.
  22.  
  23. /# {( )print} def
  24.  
  25. /-pathforall /pathforall load def
  26. /-p2 { ( ) print exch =only ( ) print =only } bind def
  27. /-tp2 { transform -p2 } bind def
  28. /-dict 5 dict def
  29.  
  30. /pathforall
  31.  { -dict begin
  32.    /-close exch def  /-curve exch def  /-line exch def  /-move exch def
  33.    end
  34.    {2 copy -p2 ( moveto\t%)print
  35.     2 copy -tp2 (\n)print
  36.     flush  -dict /-move get exec}
  37.    {2 copy -p2 ( lineto\t%)print
  38.     2 copy -tp2 (\n)print
  39.     flush  -dict /-line get exec}
  40.    {5 index 5 index -p2 3 index 3 index -p2 2 copy -p2 ( curveto\t%)print
  41.     5 index 5 index -tp2 3 index 3 index -tp2 2 copy -tp2 (\n)print
  42.     flush  -dict /-curve get exec}
  43.    {(closepath\n)print flush   -dict /-close get exec}
  44.    -pathforall
  45.   }
  46.  def
  47.  
  48. % Just print the current path
  49.  
  50. /printpath
  51.  { {pop pop} {pop pop} {pop pop pop pop pop pop} {} pathforall } def
  52.